.pybi-tooltip {
  position: absolute;
  display: block;
  background: #00000000;

  pointer-events: none;
  user-select: none;
  opacity: 1;
}

.pybi-tooltip::before {
  content: "";
  position: absolute;
  border-width: 4px 6px 0 6px;
  border-style: solid;
  border-color: transparent;
  border-top-color: black;
  z-index: 99;
  opacity: 0;

  top: -5px;
  left: 50%;
  transform: translateX(-50%);
}

.pybi-tooltip::after {
  content: attr(data-pybi-tooltip);
  position: absolute;
  background: black;
  text-align: center;
  color: #fff;
  border-radius: 5px;
  padding: 4px 2px;
  min-width: 80px;
  pointer-events: none;
  z-index: 99;
  opacity: 0;

  left: 50%;
  top: -5px;
  transform: translateX(-50%) translateY(-100%);
}

.pybi-tooltip[data-pybi-tooltip]::after,
.pybi-tooltip[data-pybi-tooltip]::before {
  opacity: 1;
}

/* 右侧 */
.pybi-tooltip[data-pybi-tooltip][position='right']::before {
  top: 50%;
  left: 100%;
  margin-left: -3px;
  transform: translateY(-50%) rotate(90deg);
}

.pybi-tooltip[data-pybi-tooltip][position='right']::after {
  top: 50%;
  left: 100%;
  margin-left: 5px;
  transform: translateY(-50%);
}

/* 左侧 */
.pybi-tooltip[data-pybi-tooltip][position='left']::before {
  top: 50%;
  left: 0;
  margin-left: -9px;
  transform: translateY(-50%) rotate(-90deg);
}

.pybi-tooltip[data-pybi-tooltip][position='left']::after {
  top: 50%;
  left: 0;
  margin-left: -5px;
  transform: translateY(-50%) translateX(-100%);
}

/* 底侧 */
.pybi-tooltip[data-pybi-tooltip][position='bottom']::before {
  top: 100%;
  left: 50%;
  margin-top: 1px;
  transform: translatex(-50%) rotate(180deg);
}

.pybi-tooltip[data-pybi-tooltip][position='bottom']::after {
  top: 100%;
  left: 50%;
  margin-top: 5px;
  transform: translatex(-50%);
}